<template>
  <div class="vue-node-wrapper">
    <!-- <div class="vue-node-header">{{ nodeData.name }}</div> -->
    <div class="vue-node-body">
      <span>
        <i class="icon iconfont icon-edit"></i>
        <span class="vue-node-title">{{ nodeData.name }}</span>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name: "vue-node",
  inject: ["getGraph", "getNode"],
  data() {
    return {
      nodeData: this.getNode().getData(),
    };
  },
};
</script>

<style lang="less">
.vue-node-wrapper {
  width: 100%;
  height: 100%;
  border: 2px solid #000;
  border-radius: 2px;
  overflow: hidden;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;

  // &:hover {
  //   border-color: yellowgreen;
  // }

  // &:active {
  //   border-color: tomato;
  // }

  .vue-node-header {
    width: 100%;
    height: 20px;
    background-color: #6fa8dc;
    color: white;
    line-height: 20px;
    text-align: center;
  }

  .vue-node-body {
    width: 100%;
    flex: 1;
    // background-color: #444;

    display: flex;
    justify-content: space-around;
    align-items: center;

    .vue-node-title {
      margin-left: 10px;
    }
  }
}
</style>
